﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ASBCC.Business;

namespace BEGDC.CC.Web.Admin
{
    /// <summary>
    /// TODO: Add some comments
    /// </summary>
    public partial class ExceptionView : EntityPage
    {

        protected override GridView EntityGrid
        {
            get { return this.GridView1; }
        }

        protected override DetailsView EntityDetails
        {
            get { return this.DetailsView1; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            //if(string.IsNullOrEmpty(this.GridView1.SortExpression))
            //    this.GridView1.Sort("ID", SortDirection.Descending);
        }

        protected override EntityDataSource EntitySource
        {
            get { return this.EntityDataSource1; }
        }

        protected override TextBox EntitySearchTxt
        {
            get { return this.SearchText; }
        }

        protected override Button EntityAddBtn
        {
            get { return this.BtnAdd; }
        }
        protected override Button EntitySearchBtn
        {
            get { return this.Searchbtn; }
        }

        protected override Button EntityClearBtn
        {
            get { return this.Cleanbtn; }
        }

        protected override void OnEntityDisabling(int entityKey)
        {
            return;
        }

        protected override void OnEntityInserting(EntityDataSourceChangingEventArgs e)
        {
            return;
        }

        protected override void OnEntityUpdating(EntityDataSourceChangingEventArgs e)
        {
            return;
        }

        protected override string GetEntityWhereExpression(string keyword)
        {
            return "(it.ExceptionMessage like N'%" + keyword + "%')";
        }

        //protected override void OnPreRender(EventArgs e)
        //{
        //    base.OnPreRender(e);

        //    this.EntityAddBtn.Visible = false;
        //    this.EntityDetails.ChangeMode(DetailsViewMode.ReadOnly);
        //}
    }
}
